package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 使用流连接完成PW的创建
 */
public class PWDemo2 {
    public static void main(String[] args) throws Exception {
        FileOutputStream fos = new FileOutputStream("pw.txt",true);
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);
        //true自动行刷新
        PrintWriter pw = new PrintWriter(bw,true);
        pw.println("如果再看你一眼");
        pw.println("是否还会有感觉");
        System.out.println("写入完毕");
        pw.close();
    }

}
